﻿@model System.Web.Mvc.HandleErrorInfo

@{
    string ExceptionMessage = String.Empty;

    if (Model.Exception.InnerException != null){
        ExceptionMessage = Model.Exception.InnerException.Message;}
    else{
        ExceptionMessage = Model.Exception.Message;}       
}

@{
    if (!Request.IsAjaxRequest())
    {
        ViewBag.Title = "Ошибка";
        Layout = "~/Views/Shared/_Layout.cshtml";
    }
}

@{
   if (!Request.IsAjaxRequest())
   {
        <header class="jumbotron subhead" id="overview">
            <h3>Ошибка при выполнении операции</h3>
            <p class="lead">@ExceptionMessage</p>
        </header>       
   }
   else
   {
       var result = new { success = false, message = ExceptionMessage };
       Response.Write(Json.Encode(result));
   }    
}

